home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue66 / Construc / DrBob42_c.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-12-29  |  39.0 KB  |  1,232 lines

  1. unit DrBob42_c;
  2.  
  3. {This file was generated on 29 Dec 2000 10:39:41 GMT by version 03.03.03.C1.06}
  4. {of the Inprise VisiBroker idl2pas CORBA IDL compiler.                        }
  5.  
  6. {Please do not edit the contents of this file. You should instead edit and    }
  7. {recompile the original IDL which was located in the file                     }
  8. {C:\DrBob42\Drbob42.idl.                                                      }
  9.  
  10. {Delphi Pascal unit      : DrBob42_c                                          }
  11. {derived from IDL module : DrBob42                                            }
  12.  
  13.  
  14.  
  15. interface
  16.  
  17. uses
  18.   CORBA,
  19.   DrBob42_i;
  20.  
  21. type
  22.   TRatesHelper = class;
  23.   TRatesStub = class;
  24.   TAccountHelper = class;
  25.   TAccountStub = class;
  26.   TAccountErrorHelper = class;
  27.   TAccountError = class;
  28.   EAccountException = class;
  29.   TMyAccountHelper = class;
  30.   TMyAccountStub = class;
  31.   TIdentifierHelper = class;
  32.   TEnumTypeHelper = class;
  33.   TStructTypeHelper = class;
  34.   TStructType = class;
  35.   TUnionTypeHelper = class;
  36.   TUnionType = class;
  37.   TStructArrayHelper = class;
  38.   TStructSequenceHelper = class;
  39.   TADTHelper = class;
  40.   TADTStub = class;
  41.   TIntSeqHelper = class;
  42.   TSeqAccountHelper = class;
  43.   TSeqAccountStub = class;
  44.  
  45.   TRatesHelper = class
  46.     class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.Rates);
  47.     class function  Extract(var _A: CORBA.Any) : DrBob42_i.Rates;
  48.     class function  TypeCode     : CORBA.TypeCode;
  49.     class function  RepositoryId : string;
  50.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.Rates;
  51.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Rates);
  52.     class function  Narrow(const _Obj   : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.Rates;
  53.     class function  Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Rates; overload;
  54.     class function  Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Rates; overload;
  55.   end;
  56.  
  57.   TRatesStub = class(CORBA.TCORBAObject, DrBob42_i.Rates)
  58.   public
  59.     function  interest_rate : Single; virtual;
  60.   end;
  61.  
  62.   TAccountHelper = class
  63.     class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.Account);
  64.     class function  Extract(var _A: CORBA.Any) : DrBob42_i.Account;
  65.     class function  TypeCode     : CORBA.TypeCode;
  66.     class function  RepositoryId : string;
  67.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.Account;
  68.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Account);
  69.     class function  Narrow(const _Obj   : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.Account;
  70.     class function  Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Account; overload;
  71.     class function  Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Account; overload;
  72.   end;
  73.  
  74.   TAccountStub = class(CORBA.TCORBAObject, DrBob42_i.Account)
  75.   public
  76.     function  balance : Single; virtual;
  77.     function  get_rates ( const myRates : DrBob42_i.Rates): Single; virtual;
  78.   end;
  79.  
  80.   TAccountErrorHelper = class
  81.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.AccountError);
  82.     class function  Extract(const _A: CORBA.Any): DrBob42_i.AccountError;
  83.     class function  TypeCode    : CORBA.TypeCode;
  84.     class function  RepositoryId: string;
  85.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.AccountError;
  86.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.AccountError);
  87.   end;
  88.  
  89.   TAccountError = class (TInterfacedObject, DrBob42_i.AccountError)
  90.   private
  91.     Balance : Single;
  92.     ErrorMessage : AnsiString;
  93.     constructor Create; overload;
  94.   public
  95.     function  _get_Balance : Single; virtual;
  96.     procedure _set_Balance ( const _value : Single ); virtual;
  97.     function  _get_ErrorMessage : AnsiString; virtual;
  98.     procedure _set_ErrorMessage ( const _value : AnsiString ); virtual;
  99.     constructor Create (const Balance : Single;
  100.                             const ErrorMessage : AnsiString
  101.                        ); overload;
  102.   end;
  103.  
  104.   EAccountException = class(UserException)
  105.   private
  106.     FError : DrBob42_i.AccountError;
  107.   protected
  108.     function  _get_Error : DrBob42_i.AccountError; virtual;
  109.   public
  110.     property  Error : DrBob42_i.AccountError read _get_Error;
  111.     constructor Create; overload;
  112.     constructor Create(const Error : DrBob42_i.AccountError); overload;
  113.     procedure Copy(const _Input : InputStream); override;
  114.     procedure WriteExceptionInfo(var _Output : OutputStream); override;
  115.   end;
  116.  
  117.   TMyAccountHelper = class
  118.     class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.MyAccount);
  119.     class function  Extract(var _A: CORBA.Any) : DrBob42_i.MyAccount;
  120.     class function  TypeCode     : CORBA.TypeCode;
  121.     class function  RepositoryId : string;
  122.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.MyAccount;
  123.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.MyAccount);
  124.     class function  Narrow(const _Obj   : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.MyAccount;
  125.     class function  Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.MyAccount; overload;
  126.     class function  Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.MyAccount; overload;
  127.   end;
  128.  
  129.   TMyAccountStub = class(CORBA.TCORBAObject, DrBob42_i.MyAccount)
  130.   public
  131.     procedure deposit ( const amount : Single); virtual;
  132.     procedure withdraw ( const amount : Single); virtual;
  133.     function  balance : Single; virtual;
  134.     function  get_rates ( const myRates : DrBob42_i.Rates): Single; virtual;
  135.   end;
  136.  
  137.   TIdentifierHelper = class
  138.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.Identifier);
  139.     class function  Extract(const _A: CORBA.Any): DrBob42_i.Identifier;
  140.     class function  TypeCode    : CORBA.TypeCode;
  141.     class function  RepositoryId: string;
  142.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.Identifier;
  143.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Identifier);
  144.   end;
  145.  
  146.   TEnumTypeHelper = class
  147.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.EnumType);
  148.     class function  Extract(const _A: CORBA.Any): DrBob42_i.EnumType;
  149.     class function  TypeCode    : CORBA.TypeCode;
  150.     class function  RepositoryId: string;
  151.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.EnumType;
  152.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.EnumType);
  153.   end;
  154.  
  155.   TStructTypeHelper = class
  156.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.StructType);
  157.     class function  Extract(const _A: CORBA.Any): DrBob42_i.StructType;
  158.     class function  TypeCode    : CORBA.TypeCode;
  159.     class function  RepositoryId: string;
  160.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.StructType;
  161.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructType);
  162.   end;
  163.  
  164.   TStructType = class (TInterfacedObject, DrBob42_i.StructType)
  165.   private
  166.     s : SmallInt;
  167.     l : Integer;
  168.     i : DrBob42_i.Identifier;
  169.     constructor Create; overload;
  170.   public
  171.     function  _get_s : SmallInt; virtual;
  172.     procedure _set_s ( const _value : SmallInt ); virtual;
  173.     function  _get_l : Integer; virtual;
  174.     procedure _set_l ( const _value : Integer ); virtual;
  175.     function  _get_i : DrBob42_i.Identifier; virtual;
  176.     procedure _set_i ( const _value : DrBob42_i.Identifier ); virtual;
  177.     constructor Create (const s : SmallInt;
  178.                             const l : Integer;
  179.                             const i : DrBob42_i.Identifier
  180.                        ); overload;
  181.   end;
  182.  
  183.   TUnionTypeHelper = class
  184.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.UnionType);
  185.     class function  Extract(const _A: CORBA.Any): DrBob42_i.UnionType;
  186.     class function  TypeCode    : CORBA.TypeCode;
  187.     class function  RepositoryId: string;
  188.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.UnionType;
  189.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.UnionType);
  190.   end;
  191.  
  192.   TUnionType = class (TInterfacedObject, DrBob42_i.UnionType)
  193.   private
  194.     s : SmallInt;
  195.     l : Integer;
  196.     i : DrBob42_i.Identifier;
  197.     _discriminator : Integer;
  198.   public
  199.     function  _get_s : SmallInt; virtual;
  200.     procedure _set_s ( const _value : SmallInt ); virtual;
  201.     function  _get_l : Integer; virtual;
  202.     procedure _set_l ( const _value : Integer ); virtual;
  203.     function  _get_i : DrBob42_i.Identifier; virtual;
  204.     procedure _set_i ( const _value : DrBob42_i.Identifier ); virtual;
  205.     function  _get_discriminator : Integer; virtual;
  206.     constructor Create;
  207.   end;
  208.  
  209.   TStructArrayHelper = class
  210.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.StructArray);
  211.     class function  Extract(const _A: CORBA.Any): DrBob42_i.StructArray;
  212.     class function  TypeCode    : CORBA.TypeCode;
  213.     class function  RepositoryId: string;
  214.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.StructArray;
  215.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructArray);
  216.   end;
  217.  
  218.   TStructSequenceHelper = class
  219.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.StructSequence);
  220.     class function  Extract(const _A: CORBA.Any): DrBob42_i.StructSequence;
  221.     class function  TypeCode    : CORBA.TypeCode;
  222.     class function  RepositoryId: string;
  223.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.StructSequence;
  224.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructSequence);
  225.   end;
  226.  
  227.   TADTHelper = class
  228.     class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.ADT);
  229.     class function  Extract(var _A: CORBA.Any) : DrBob42_i.ADT;
  230.     class function  TypeCode     : CORBA.TypeCode;
  231.     class function  RepositoryId : string;
  232.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.ADT;
  233.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.ADT);
  234.     class function  Narrow(const _Obj   : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.ADT;
  235.     class function  Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.ADT; overload;
  236.     class function  Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.ADT; overload;
  237.   end;
  238.  
  239.   TADTStub = class(CORBA.TCORBAObject, DrBob42_i.ADT)
  240.   public
  241.     procedure test ( const one : DrBob42_i.Identifier;
  242.                      const two : DrBob42_i.EnumType;
  243.                      const three : DrBob42_i.StructType;
  244.                      const four : DrBob42_i.UnionType;
  245.                      const five : DrBob42_i.StructArray;
  246.                      const six : DrBob42_i.StructSequence); virtual;
  247.   end;
  248.  
  249.   TIntSeqHelper = class
  250.     class procedure Insert (var   _A: CORBA.Any; const _Value : DrBob42_i.IntSeq);
  251.     class function  Extract(const _A: CORBA.Any): DrBob42_i.IntSeq;
  252.     class function  TypeCode    : CORBA.TypeCode;
  253.     class function  RepositoryId: string;
  254.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.IntSeq;
  255.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.IntSeq);
  256.   end;
  257.  
  258.   TSeqAccountHelper = class
  259.     class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.SeqAccount);
  260.     class function  Extract(var _A: CORBA.Any) : DrBob42_i.SeqAccount;
  261.     class function  TypeCode     : CORBA.TypeCode;
  262.     class function  RepositoryId : string;
  263.     class function  Read (const _Input  : CORBA.InputStream) : DrBob42_i.SeqAccount;
  264.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.SeqAccount);
  265.     class function  Narrow(const _Obj   : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.SeqAccount;
  266.     class function  Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.SeqAccount; overload;
  267.     class function  Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.SeqAccount; overload;
  268.   end;
  269.  
  270.   TSeqAccountStub = class(CORBA.TCORBAObject, DrBob42_i.SeqAccount)
  271.   public
  272.     function  balance ( const mySeq : DrBob42_i.IntSeq): Single; virtual;
  273.   end;
  274.  
  275.  
  276. implementation
  277.  
  278.  
  279. var
  280.  
  281.   AccountExceptionDesc : PExceptionDescription;
  282.  
  283. class procedure TRatesHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.Rates);
  284. begin
  285.   _A := Orb.MakeObjectRef( TRatesHelper.TypeCode, _Value as CORBA.CORBAObject);
  286. end;
  287.  
  288. class function TRatesHelper.Extract(var _A : CORBA.Any): DrBob42_i.Rates;
  289. var
  290.   _obj : Corba.CorbaObject;
  291. begin
  292.   _obj := Orb.GetObjectRef(_A);
  293.   Result := TRatesHelper.Narrow(_obj, True);
  294. end;
  295.  
  296. class function TRatesHelper.TypeCode : CORBA.TypeCode;
  297. begin
  298.   Result := ORB.CreateInterfaceTC(RepositoryId, 'Rates');
  299. end;
  300.  
  301. class function TRatesHelper.RepositoryId : string;
  302. begin
  303.   Result := 'IDL:DrBob42/Rates:1.0';
  304. end;
  305.  
  306. class function TRatesHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.Rates;
  307. var
  308.   _Obj : CORBA.CORBAObject;
  309. begin
  310.   _Input.ReadObject(_Obj);
  311.   Result := Narrow(_Obj, True)
  312. end;
  313.  
  314. class procedure TRatesHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Rates);
  315. begin
  316.   _Output.WriteObject(_Value as CORBA.CORBAObject);
  317. end;
  318.  
  319. class function TRatesHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.Rates;
  320. begin
  321.   Result := nil;
  322.   if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.Rates, Result) = 0) then
  323.     exit;
  324.   if _IsA and _Obj._IsA(RepositoryId) then
  325.     Result := TRatesStub.Create(_Obj);
  326. end;
  327.  
  328. class function TRatesHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Rates;
  329. begin
  330.   Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
  331. end;
  332.  
  333. class function TRatesHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Rates;
  334. begin
  335.   Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
  336. end;
  337.  
  338. function  TRatesStub.interest_rate : Single;
  339. var
  340.   _Output: CORBA.OutputStream;
  341.   _Input : CORBA.InputStream;
  342. begin
  343.   inherited _CreateRequest('interest_rate',True, _Output);
  344.   inherited _Invoke(_Output, _Input);
  345.   _Input.ReadFloat(Result);
  346. end;
  347.  
  348. class procedure TAccountHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.Account);
  349. begin
  350.   _A := Orb.MakeObjectRef( TAccountHelper.TypeCode, _Value as CORBA.CORBAObject);
  351. end;
  352.  
  353. class function TAccountHelper.Extract(var _A : CORBA.Any): DrBob42_i.Account;
  354. var
  355.   _obj : Corba.CorbaObject;
  356. begin
  357.   _obj := Orb.GetObjectRef(_A);
  358.   Result := TAccountHelper.Narrow(_obj, True);
  359. end;
  360.  
  361. class function TAccountHelper.TypeCode : CORBA.TypeCode;
  362. begin
  363.   Result := ORB.CreateInterfaceTC(RepositoryId, 'Account');
  364. end;
  365.  
  366. class function TAccountHelper.RepositoryId : string;
  367. begin
  368.   Result := 'IDL:DrBob42/Account:1.0';
  369. end;
  370.  
  371. class function TAccountHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.Account;
  372. var
  373.   _Obj : CORBA.CORBAObject;
  374. begin
  375.   _Input.ReadObject(_Obj);
  376.   Result := Narrow(_Obj, True)
  377. end;
  378.  
  379. class procedure TAccountHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Account);
  380. begin
  381.   _Output.WriteObject(_Value as CORBA.CORBAObject);
  382. end;
  383.  
  384. class function TAccountHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.Account;
  385. begin
  386.   Result := nil;
  387.   if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.Account, Result) = 0) then
  388.     exit;
  389.   if _IsA and _Obj._IsA(RepositoryId) then
  390.     Result := TAccountStub.Create(_Obj);
  391. end;
  392.  
  393. class function TAccountHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Account;
  394. begin
  395.   Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
  396. end;
  397.  
  398. class function TAccountHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Account;
  399. begin
  400.   Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
  401. end;
  402.  
  403. function  TAccountStub.balance : Single;
  404. var
  405.   _Output: CORBA.OutputStream;
  406.   _Input : CORBA.InputStream;
  407. begin
  408.   inherited _CreateRequest('balance',True, _Output);
  409.   inherited _Invoke(_Output, _Input);
  410.   _Input.ReadFloat(Result);
  411. end;
  412.  
  413. function  TAccountStub.get_rates ( const myRates : DrBob42_i.Rates): Single;
  414. var
  415.   _Output: CORBA.OutputStream;
  416.   _Input : CORBA.InputStream;
  417. begin
  418.   inherited _CreateRequest('get_rates',True, _Output);
  419.   DrBob42_c.TRatesHelper.Write(_Output, myRates);
  420.   inherited _Invoke(_Output, _Input);
  421.   _Input.ReadFloat(Result);
  422. end;
  423.  
  424. class procedure TAccountErrorHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.AccountError);
  425. var
  426.   _Output : CORBA.OutputStream;
  427. begin
  428.   _Output := ORB.CreateOutputStream;
  429.   TAccountErrorHelper.Write(_Output, _Value);
  430.   ORB.PutAny(_A, TAccountErrorHelper.TypeCode, _Output);
  431. end;
  432.  
  433. class function TAccountErrorHelper.Extract(const _A : CORBA.Any) : DrBob42_i.AccountError;
  434. var
  435.   _Input : CORBA.InputStream;
  436. begin
  437.   Orb.GetAny(_A, _Input);
  438.   Result := TAccountErrorHelper.Read(_Input);
  439. end;
  440.  
  441. class function TAccountErrorHelper.TypeCode : CORBA.TypeCode;
  442. var
  443.   _Seq: StructMemberSeq;
  444. begin
  445.   SetLength(_Seq, 2);
  446.   _Seq[0].Name := 'Balance';
  447.   _Seq[0].TC   := ORB.CreateTC(Integer(tk_float));
  448.   _Seq[1].Name := 'ErrorMessage';
  449.   _Seq[1].TC   := ORB.CreateTC(Integer(tk_string));
  450.   Result := ORB.MakeStructureTypecode(RepositoryID, 'AccountError', _Seq);
  451. end;
  452.  
  453. class function TAccountErrorHelper.RepositoryId : string;
  454. begin
  455.   Result := 'IDL:DrBob42/AccountError:1.0';
  456. end;
  457.  
  458. class function TAccountErrorHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.AccountError;
  459. var
  460.   _Value : DrBob42_c.TAccountError;
  461. begin
  462.   _Value := DrBob42_c.TAccountError.Create;
  463.   _Input.ReadFloat(_Value.Balance);
  464.   _Input.ReadString(_Value.ErrorMessage);
  465.   Result := _Value;
  466. end;
  467.  
  468. class procedure TAccountErrorHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.AccountError);
  469. begin
  470.   _Output.WriteFloat(_Value.Balance);
  471.   _Output.WriteString(_Value.ErrorMessage);
  472. end;
  473.  
  474. constructor TAccountError.Create;
  475. begin
  476.   inherited Create;
  477. end;
  478.  
  479. constructor TAccountError.Create(const Balance: Single;
  480.                                  const ErrorMessage: AnsiString);
  481. begin
  482.   Self.Balance := Balance;
  483.   Self.ErrorMessage := ErrorMessage;
  484. end;
  485.  
  486. function  TAccountError._get_Balance: Single;
  487. begin
  488.   Result := Balance;
  489. end;
  490.  
  491. procedure TAccountError._set_Balance(const _Value : Single);
  492. begin
  493.   Balance := _Value;
  494. end;
  495.  
  496. function  TAccountError._get_ErrorMessage: AnsiString;
  497. begin
  498.   Result := ErrorMessage;
  499. end;
  500.  
  501. procedure TAccountError._set_ErrorMessage(const _Value : AnsiString);
  502. begin
  503.   ErrorMessage := _Value;
  504. end;
  505.  
  506.  
  507. function  EAccountException._get_Error : DrBob42_i.AccountError;
  508. begin
  509.   Result := FError;
  510. end;
  511.  
  512.  
  513. constructor EAccountException.Create;
  514. begin
  515.   inherited Create;
  516. end;
  517.  
  518. constructor EAccountException.Create(const Error : DrBob42_i.AccountError);
  519. begin
  520.   inherited Create;
  521.   FError := Error;
  522. end;
  523.  
  524. procedure EAccountException.Copy(const _Input: InputStream);
  525. begin
  526.   FError := DrBob42_c.TAccountErrorHelper.Read(_Input);
  527. end;
  528.  
  529. procedure EAccountException.WriteExceptionInfo(var _Output : OutputStream);
  530. begin
  531.   _Output.WriteString('IDL:DrBob42/AccountException:1.0');
  532.   DrBob42_c.TAccountErrorHelper.Write(_Output, FError);
  533. end;
  534. function  AccountException_Factory: PExceptionProxy; cdecl;
  535. begin
  536.   with DrBob42_c.EAccountException.Create() do Result := Proxy;
  537. end;
  538.  
  539. class procedure TMyAccountHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.MyAccount);
  540. begin
  541.   _A := Orb.MakeObjectRef( TMyAccountHelper.TypeCode, _Value as CORBA.CORBAObject);
  542. end;
  543.  
  544. class function TMyAccountHelper.Extract(var _A : CORBA.Any): DrBob42_i.MyAccount;
  545. var
  546.   _obj : Corba.CorbaObject;
  547. begin
  548.   _obj := Orb.GetObjectRef(_A);
  549.   Result := TMyAccountHelper.Narrow(_obj, True);
  550. end;
  551.  
  552. class function TMyAccountHelper.TypeCode : CORBA.TypeCode;
  553. begin
  554.   Result := ORB.CreateInterfaceTC(RepositoryId, 'MyAccount');
  555. end;
  556.  
  557. class function TMyAccountHelper.RepositoryId : string;
  558. begin
  559.   Result := 'IDL:DrBob42/MyAccount:1.0';
  560. end;
  561.  
  562. class function TMyAccountHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.MyAccount;
  563. var
  564.   _Obj : CORBA.CORBAObject;
  565. begin
  566.   _Input.ReadObject(_Obj);
  567.   Result := Narrow(_Obj, True)
  568. end;
  569.  
  570. class procedure TMyAccountHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.MyAccount);
  571. begin
  572.   _Output.WriteObject(_Value as CORBA.CORBAObject);
  573. end;
  574.  
  575. class function TMyAccountHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.MyAccount;
  576. begin
  577.   Result := nil;
  578.   if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.MyAccount, Result) = 0) then
  579.     exit;
  580.   if _IsA and _Obj._IsA(RepositoryId) then
  581.     Result := TMyAccountStub.Create(_Obj);
  582. end;
  583.  
  584. class function TMyAccountHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.MyAccount;
  585. begin
  586.   Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
  587. end;
  588.  
  589. class function TMyAccountHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.MyAccount;
  590. begin
  591.   Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
  592. end;
  593.  
  594. procedure TMyAccountStub.deposit ( const amount : Single);
  595. var
  596.   _Output: CORBA.OutputStream;
  597.   _Input : CORBA.InputStream;
  598. begin
  599.   inherited _CreateRequest('deposit',True, _Output);
  600.   _Output.WriteFloat(amount);
  601.   inherited _Invoke(_Output, _Input);
  602. end;
  603.  
  604. procedure TMyAccountStub.withdraw ( const amount : Single);
  605. var
  606.   _Output: CORBA.OutputStream;
  607.   _Input : CORBA.InputStream;
  608. begin
  609.   inherited _CreateRequest('withdraw',True, _Output);
  610.   _Output.WriteFloat(amount);
  611.   inherited _Invoke(_Output, _Input);
  612. end;
  613.  
  614. function  TMyAccountStub.balance : Single;
  615. var
  616.   _Output: CORBA.OutputStream;
  617.   _Input : CORBA.InputStream;
  618. begin
  619.   inherited _CreateRequest('balance',True, _Output);
  620.   inherited _Invoke(_Output, _Input);
  621.   _Input.ReadFloat(Result);
  622. end;
  623.  
  624. function  TMyAccountStub.get_rates ( const myRates : DrBob42_i.Rates): Single;
  625. var
  626.   _Output: CORBA.OutputStream;
  627.   _Input : CORBA.InputStream;
  628. begin
  629.   inherited _CreateRequest('get_rates',True, _Output);
  630.   DrBob42_c.TRatesHelper.Write(_Output, myRates);
  631.   inherited _Invoke(_Output, _Input);
  632.   _Input.ReadFloat(Result);
  633. end;
  634.  
  635. class procedure TIdentifierHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.Identifier);
  636. begin
  637.   _A := _Value;
  638. end;
  639.  
  640. class function TIdentifierHelper.Extract(const _A : CORBA.Any) : DrBob42_i.Identifier;
  641. var
  642.   _Input : InputStream;
  643.   _Temp  : AnsiString;
  644. begin
  645.   Orb.GetAny(_A, _Input);
  646.   _Input.ReadString(_Temp);
  647.   Result := DrBob42_i.Identifier(_Temp);
  648. end;
  649.  
  650. class function  TIdentifierHelper.TypeCode : CORBA.TypeCode;
  651. begin
  652.   Result := ORB.CreateAliasTC(RepositoryId, 'Identifier', ORB.CreateTC(Integer(0)));
  653. end;
  654.  
  655. class function  TIdentifierHelper.RepositoryId : string;
  656. begin
  657.   Result := 'IDL:DrBob42/Identifier:1.0';
  658. end;
  659.  
  660. class function  TIdentifierHelper.Read(const _Input: CORBA.InputStream) : DrBob42_i.Identifier;
  661. begin
  662.   _Input.ReadString(Result);
  663. end;
  664.  
  665. class procedure TIdentifierHelper.Write(const _Output : CORBA.OutputStream; const _Value :DrBob42_i.Identifier);
  666. begin
  667.   _Output.WriteString(_Value);
  668. end;
  669.  
  670. class procedure TEnumTypeHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.EnumType);
  671. begin
  672.   _A := _Value;
  673. end;
  674.  
  675. class function TEnumTypeHelper.Extract(const _A : CORBA.Any) : DrBob42_i.EnumType;
  676. begin
  677.   Result := DrBob42_i.EnumType(_A);
  678. end;
  679.  
  680. class function TEnumTypeHelper.TypeCode : CORBA.TypeCode;
  681. begin
  682.   Result := ORB.CreateEnumTC(RepositoryId, 'EnumType', ['first', 'second', 'third']);
  683. end;
  684.  
  685. class function TEnumTypeHelper.RepositoryId: string;
  686. begin
  687.   Result := 'IDL:DrBob42/EnumType:1.0';
  688. end;
  689.  
  690. class function TEnumTypeHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.EnumType;
  691. var
  692.   _Temp: Cardinal;
  693. begin
  694.   _Input.ReadULong(_Temp);
  695.   Result := DrBob42_i.EnumType(_Temp);
  696. end;
  697.  
  698. class procedure TEnumTypeHelper.Write(const _Output : CORBA.OutputStream; const _Value  : DrBob42_i.EnumType);
  699. begin
  700.   _Output.WriteULong(Cardinal(_Value));
  701. end;
  702.  
  703. class procedure TStructTypeHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.StructType);
  704. var
  705.   _Output : CORBA.OutputStream;
  706. begin
  707.   _Output := ORB.CreateOutputStream;
  708.   TStructTypeHelper.Write(_Output, _Value);
  709.   ORB.PutAny(_A, TStructTypeHelper.TypeCode, _Output);
  710. end;
  711.  
  712. class function TStructTypeHelper.Extract(const _A : CORBA.Any) : DrBob42_i.StructType;
  713. var
  714.   _Input : CORBA.InputStream;
  715. begin
  716.   Orb.GetAny(_A, _Input);
  717.   Result := TStructTypeHelper.Read(_Input);
  718. end;
  719.  
  720. class function TStructTypeHelper.TypeCode : CORBA.TypeCode;
  721. var
  722.   _Seq: StructMemberSeq;
  723. begin
  724.   SetLength(_Seq, 3);
  725.   _Seq[0].Name := 's';
  726.   _Seq[0].TC   := ORB.CreateTC(Integer(tk_short));
  727.   _Seq[1].Name := 'l';
  728.   _Seq[1].TC   := ORB.CreateTC(Integer(tk_long));
  729.   _Seq[2].Name := 'i';
  730.   _Seq[2].TC   := DrBob42_c.TIdentifierHelper.TypeCode;
  731.   Result := ORB.MakeStructureTypecode(RepositoryID, 'StructType', _Seq);
  732. end;
  733.  
  734. class function TStructTypeHelper.RepositoryId : string;
  735. begin
  736.   Result := 'IDL:DrBob42/StructType:1.0';
  737. end;
  738.  
  739. class function TStructTypeHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.StructType;
  740. var
  741.   _Value : DrBob42_c.TStructType;
  742. begin
  743.   _Value := DrBob42_c.TStructType.Create;
  744.   _Input.ReadShort(_Value.s);
  745.   _Input.ReadLong(_Value.l);
  746.   _Value.i := DrBob42_c.TIdentifierHelper.Read(_Input);
  747.   Result := _Value;
  748. end;
  749.  
  750. class procedure TStructTypeHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructType);
  751. begin
  752.   _Output.WriteShort(_Value.s);
  753.   _Output.WriteLong(_Value.l);
  754.   DrBob42_c.TIdentifierHelper.Write(_Output, _Value.i);
  755. end;
  756.  
  757. constructor TStructType.Create;
  758. begin
  759.   inherited Create;
  760. end;
  761.  
  762. constructor TStructType.Create(const s: SmallInt;
  763.                                const l: Integer;
  764.                                const i: DrBob42_i.Identifier);
  765. begin
  766.   Self.s := s;
  767.   Self.l := l;
  768.   Self.i := i;
  769. end;
  770.  
  771. function  TStructType._get_s: SmallInt;
  772. begin
  773.   Result := s;
  774. end;
  775.  
  776. procedure TStructType._set_s(const _Value : SmallInt);
  777. begin
  778.   s := _Value;
  779. end;
  780.  
  781. function  TStructType._get_l: Integer;
  782. begin
  783.   Result := l;
  784. end;
  785.  
  786. procedure TStructType._set_l(const _Value : Integer);
  787. begin
  788.   l := _Value;
  789. end;
  790.  
  791. function  TStructType._get_i: DrBob42_i.Identifier;
  792. begin
  793.   Result := i;
  794. end;
  795.  
  796. procedure TStructType._set_i(const _Value : DrBob42_i.Identifier);
  797. begin
  798.   i := _Value;
  799. end;
  800.  
  801. class procedure TUnionTypeHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.UnionType);
  802. var
  803.   _Output : CORBA.OutputStream;
  804. begin
  805.   _Output := ORB.CreateOutputStream;
  806.   TUnionTypeHelper.Write(_Output, _Value);
  807.   ORB.PutAny(_A, TUnionTypeHelper.TypeCode, _Output);
  808. end;
  809.  
  810. class function TUnionTypeHelper.Extract(const _A : CORBA.Any) : DrBob42_i.UnionType;
  811. var
  812.   _Input : CORBA.InputStream;
  813. begin
  814.   Orb.GetAny(_A, _Input);
  815.   Result := TUnionTypeHelper.Read(_Input);
  816. end;
  817.  
  818. class function TUnionTypeHelper.TypeCode : CORBA.TypeCode;
  819. var
  820.   Seq: UnionMemberSeq;
  821. begin
  822.   SetLength(Seq, 3);
  823.   Seq[0].Member_Name := 's';
  824.   Seq[0].Member_Label:= -1;
  825.   Seq[0].Member_TC   := ORB.CreateTC(Integer(tk_short));
  826.   Seq[1].Member_Name := 'l';
  827.   Seq[1].Member_Label:= 0;
  828.   Seq[1].Member_TC   := ORB.CreateTC(Integer(tk_long));
  829.   Seq[2].Member_Name := 'i';
  830.   Seq[2].Member_Label:= 1;
  831.   Seq[2].Member_TC   := DrBob42_c.TIdentifierHelper.TypeCode;
  832.   Result := ORB.CreateUnionTC(RepositoryID, 'UnionType', ORB.CreateTC(Integer(tk_long)), Seq);
  833. end;
  834.  
  835. class function TUnionTypeHelper.RepositoryId: string;
  836. begin
  837.   Result := 'IDL:DrBob42/UnionType:1.0';
  838. end;
  839.  
  840. class function TUnionTypeHelper.Read(const _Input: CORBA.InputStream): DrBob42_i.UnionType;
  841. var
  842.   _Value : DrBob42_c.TUnionType;
  843. begin
  844.   _Value := TUnionType.Create;
  845.   _Input.ReadLong(_Value._discriminator);
  846.   case _Value._discriminator of
  847.     -1 : _Input.ReadShort(_Value.s); 
  848.     0 : _Input.ReadLong(_Value.l); 
  849.     1 : _Value.i := DrBob42_c.TIdentifierHelper.Read(_Input); 
  850.   end;
  851.   Result := _Value;
  852. end;
  853.  
  854. class procedure TUnionTypeHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.UnionType);
  855. begin
  856.   _Output.WriteLong(_Value._discriminator);
  857.   case _Value._discriminator of
  858.     -1 : _Output.WriteShort(_Value.s);
  859.     0 : _Output.WriteLong(_Value.l);
  860.     1 : DrBob42_c.TIdentifierHelper.Write(_Output, _Value.i);
  861.   end;
  862. end;
  863.  
  864. constructor TUnionType.Create;
  865. begin
  866.   Self._discriminator := Integer($80000000);
  867. end;
  868.  
  869. function  TUnionType._get_discriminator: Integer;
  870. begin
  871.   Result := _discriminator;
  872. end;
  873.  
  874. function  TUnionType._get_s: SmallInt;
  875. begin
  876.   if ( ( _discriminator <> -1 ) 
  877.       )
  878.     then raise BAD_OPERATION.Create(0, COMPLETED_YES);
  879.   Result := s;
  880. end;
  881.  
  882. procedure TUnionType._set_s(const _Value : SmallInt);
  883. begin
  884.   _discriminator := -1;
  885.   s := _Value;
  886. end;
  887.  
  888. function  TUnionType._get_l: Integer;
  889. begin
  890.   if ( ( _discriminator <> 0 ) 
  891.       )
  892.     then raise BAD_OPERATION.Create(0, COMPLETED_YES);
  893.   Result := l;
  894. end;
  895.  
  896. procedure TUnionType._set_l(const _Value : Integer);
  897. begin
  898.   _discriminator := 0;
  899.   l := _Value;
  900. end;
  901.  
  902. function  TUnionType._get_i: DrBob42_i.Identifier;
  903. begin
  904.   if ( ( _discriminator <> 1 ) 
  905.       )
  906.     then raise BAD_OPERATION.Create(0, COMPLETED_YES);
  907.   Result := i;
  908. end;
  909.  
  910. procedure TUnionType._set_i(const _Value : DrBob42_i.Identifier);
  911. begin
  912.   _discriminator := 1;
  913.   i := _Value;
  914. end;
  915.  
  916. class procedure TStructArrayHelper.Insert(var _A: CORBA.Any; const _Value : DrBob42_i.StructArray);
  917. var
  918.   _Output : CORBA.OutputStream;
  919. begin
  920.   _Output := ORB.CreateOutputStream;
  921.   TStructArrayHelper.Write(_Output, _Value);
  922.   ORB.PutAny(_A, TStructArrayHelper.TypeCode, _Output);
  923. end;
  924.  
  925. class function  TStructArrayHelper.Extract(const _A : CORBA.Any): DrBob42_i.StructArray;
  926. var
  927.   _Input : CORBA.InputStream;
  928. begin
  929.   Orb.GetAny(_A, _Input);
  930.   Result := TStructArrayHelper.Read(_Input);
  931. end;
  932.  
  933. class function  TStructArrayHelper.TypeCode: CORBA.TypeCode;
  934. begin
  935.   Result := ORB.CreateArrayTC(3, DrBob42_c.TStructTypeHelper.TypeCode());
  936. end;
  937.  
  938. class function  TStructArrayHelper.RepositoryId: string;
  939. begin
  940.   Result := 'IDL:DrBob42/StructArray:1.0';
  941. end;
  942.  
  943. class function  TStructArrayHelper.Read(const _Input: CORBA.InputStream) : DrBob42_i.StructArray;
  944. var
  945.   I0 : Cardinal;
  946. begin
  947.   for I0 := 0 to 2 do
  948.   begin
  949.     Result[I0] := DrBob42_c.TStructTypeHelper.Read(_Input);
  950.   end;
  951. end;
  952.  
  953. class procedure TStructArrayHelper.Write(const _Output: CORBA.OutputStream; const _Value: DrBob42_i.StructArray);
  954. var
  955.   I0 : Cardinal;
  956. begin
  957.   for I0 := 0 to 2 do
  958.   begin
  959.     DrBob42_c.TStructTypeHelper.Write(_Output, _Value[I0]);
  960.   end;
  961. end;
  962.  
  963. class procedure TStructSequenceHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.StructSequence);
  964. var
  965.   _Output : CORBA.OutputStream;
  966. begin
  967.   _Output := ORB.CreateOutputStream;
  968.   TStructSequenceHelper.Write(_Output, _Value);
  969.   ORB.PutAny(_A, TStructSequenceHelper.TypeCode, _Output);
  970. end;
  971.  
  972. class function TStructSequenceHelper.Extract(const _A : CORBA.Any): DrBob42_i.StructSequence;
  973. var
  974.   _Input : InputStream;
  975. begin
  976.   Orb.GetAny(_A, _Input);
  977.   Result := TStructSequenceHelper.Read(_Input);
  978. end;
  979.  
  980. class function  TStructSequenceHelper.TypeCode: CORBA.TypeCode;
  981. begin
  982.   Result := ORB.CreateSequenceTC(0, DrBob42_c.TStructTypeHelper.TypeCode());
  983. end;
  984.  
  985. class function  TStructSequenceHelper.RepositoryId: string;
  986. begin
  987.   Result := 'IDL:DrBob42/StructSequence:1.0';
  988. end;
  989.  
  990. class function  TStructSequenceHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.StructSequence;
  991. var
  992.   L0 : Cardinal;
  993.   I0 : Cardinal;
  994. begin
  995.   _Input.ReadULong(L0);
  996.   SetLength(Result, L0);
  997.   if (L0 > 0) then
  998.   begin
  999.     for I0 := 0 to High(Result) do
  1000.     begin
  1001.       Result[I0] := DrBob42_c.TStructTypeHelper.Read(_Input);
  1002.     end;
  1003.   end;
  1004. end;
  1005.  
  1006. class procedure TStructSequenceHelper.Write(const _Output: CORBA.OutputStream; const _Value: DrBob42_i.StructSequence);
  1007. var
  1008.   L0 : Cardinal;
  1009.   I0 : Cardinal;
  1010. begin
  1011.   L0 := Length(_Value);
  1012.   _Output.WriteULong(L0);
  1013.   if (L0 > 0) then
  1014.   begin
  1015.     for I0 := 0 to High(_Value) do
  1016.     begin
  1017.       DrBob42_c.TStructTypeHelper.Write(_Output, _Value[I0]);
  1018.     end;
  1019.   end;
  1020. end;
  1021.  
  1022. class procedure TADTHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.ADT);
  1023. begin
  1024.   _A := Orb.MakeObjectRef( TADTHelper.TypeCode, _Value as CORBA.CORBAObject);
  1025. end;
  1026.  
  1027. class function TADTHelper.Extract(var _A : CORBA.Any): DrBob42_i.ADT;
  1028. var
  1029.   _obj : Corba.CorbaObject;
  1030. begin
  1031.   _obj := Orb.GetObjectRef(_A);
  1032.   Result := TADTHelper.Narrow(_obj, True);
  1033. end;
  1034.  
  1035. class function TADTHelper.TypeCode : CORBA.TypeCode;
  1036. begin
  1037.   Result := ORB.CreateInterfaceTC(RepositoryId, 'ADT');
  1038. end;
  1039.  
  1040. class function TADTHelper.RepositoryId : string;
  1041. begin
  1042.   Result := 'IDL:DrBob42/ADT:1.0';
  1043. end;
  1044.  
  1045. class function TADTHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.ADT;
  1046. var
  1047.   _Obj : CORBA.CORBAObject;
  1048. begin
  1049.   _Input.ReadObject(_Obj);
  1050.   Result := Narrow(_Obj, True)
  1051. end;
  1052.  
  1053. class procedure TADTHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.ADT);
  1054. begin
  1055.   _Output.WriteObject(_Value as CORBA.CORBAObject);
  1056. end;
  1057.  
  1058. class function TADTHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.ADT;
  1059. begin
  1060.   Result := nil;
  1061.   if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.ADT, Result) = 0) then
  1062.     exit;
  1063.   if _IsA and _Obj._IsA(RepositoryId) then
  1064.     Result := TADTStub.Create(_Obj);
  1065. end;
  1066.  
  1067. class function TADTHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.ADT;
  1068. begin
  1069.   Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
  1070. end;
  1071.  
  1072. class function TADTHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.ADT;
  1073. begin
  1074.   Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
  1075. end;
  1076.  
  1077. procedure TADTStub.test ( const one : DrBob42_i.Identifier;
  1078.                           const two : DrBob42_i.EnumType;
  1079.                           const three : DrBob42_i.StructType;
  1080.                           const four : DrBob42_i.UnionType;
  1081.                           const five : DrBob42_i.StructArray;
  1082.                           const six : DrBob42_i.StructSequence);
  1083. var
  1084.   _Output: CORBA.OutputStream;
  1085.   _Input : CORBA.InputStream;
  1086. begin
  1087.   inherited _CreateRequest('test',True, _Output);
  1088.   DrBob42_c.TIdentifierHelper.Write(_Output, one);
  1089.   DrBob42_c.TEnumTypeHelper.Write(_Output, two);
  1090.   DrBob42_c.TStructTypeHelper.Write(_Output, three);
  1091.   DrBob42_c.TUnionTypeHelper.Write(_Output, four);
  1092.   DrBob42_c.TStructArrayHelper.Write(_Output, five);
  1093.   DrBob42_c.TStructSequenceHelper.Write(_Output, six);
  1094.   inherited _Invoke(_Output, _Input);
  1095. end;
  1096.  
  1097. class procedure TIntSeqHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.IntSeq);
  1098. var
  1099.   _Output : CORBA.OutputStream;
  1100. begin
  1101.   _Output := ORB.CreateOutputStream;
  1102.   TIntSeqHelper.Write(_Output, _Value);
  1103.   ORB.PutAny(_A, TIntSeqHelper.TypeCode, _Output);
  1104. end;
  1105.  
  1106. class function TIntSeqHelper.Extract(const _A : CORBA.Any): DrBob42_i.IntSeq;
  1107. var
  1108.   _Input : InputStream;
  1109. begin
  1110.   Orb.GetAny(_A, _Input);
  1111.   Result := TIntSeqHelper.Read(_Input);
  1112. end;
  1113.  
  1114. class function  TIntSeqHelper.TypeCode: CORBA.TypeCode;
  1115. begin
  1116.   Result := ORB.CreateSequenceTC(5, ORB.CreateTC(Integer(tk_long)));
  1117. end;
  1118.  
  1119. class function  TIntSeqHelper.RepositoryId: string;
  1120. begin
  1121.   Result := 'IDL:DrBob42/IntSeq:1.0';
  1122. end;
  1123.  
  1124. class function  TIntSeqHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.IntSeq;
  1125. var
  1126.   L0 : Cardinal;
  1127.   I0 : Cardinal;
  1128. begin
  1129.   _Input.ReadULong(L0);
  1130.   if (L0 > 5) then raise MARSHAL.Create(0, COMPLETED_YES);
  1131.   if (L0 > 0) then
  1132.   begin
  1133.     for I0 := 0 to High(Result) do
  1134.     begin
  1135.       _Input.ReadULong(Result[I0]);
  1136.     end;
  1137.   end;
  1138. end;
  1139.  
  1140. class procedure TIntSeqHelper.Write(const _Output: CORBA.OutputStream; const _Value: DrBob42_i.IntSeq);
  1141. var
  1142.   L0 : Cardinal;
  1143.   I0 : Cardinal;
  1144. begin
  1145.   L0 := Length(_Value);
  1146.   if (L0 > 5) then raise MARSHAL.Create(0, COMPLETED_NO);
  1147.   _Output.WriteULong(L0);
  1148.   if (L0 > 0) then
  1149.   begin
  1150.     for I0 := 0 to High(_Value) do
  1151.     begin
  1152.       _Output.WriteULong(_Value[I0]);
  1153.     end;
  1154.   end;
  1155. end;
  1156.  
  1157. class procedure TSeqAccountHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.SeqAccount);
  1158. begin
  1159.   _A := Orb.MakeObjectRef( TSeqAccountHelper.TypeCode, _Value as CORBA.CORBAObject);
  1160. end;
  1161.  
  1162. class function TSeqAccountHelper.Extract(var _A : CORBA.Any): DrBob42_i.SeqAccount;
  1163. var
  1164.   _obj : Corba.CorbaObject;
  1165. begin
  1166.   _obj := Orb.GetObjectRef(_A);
  1167.   Result := TSeqAccountHelper.Narrow(_obj, True);
  1168. end;
  1169.  
  1170. class function TSeqAccountHelper.TypeCode : CORBA.TypeCode;
  1171. begin
  1172.   Result := ORB.CreateInterfaceTC(RepositoryId, 'SeqAccount');
  1173. end;
  1174.  
  1175. class function TSeqAccountHelper.RepositoryId : string;
  1176. begin
  1177.   Result := 'IDL:DrBob42/SeqAccount:1.0';
  1178. end;
  1179.  
  1180. class function TSeqAccountHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.SeqAccount;
  1181. var
  1182.   _Obj : CORBA.CORBAObject;
  1183. begin
  1184.   _Input.ReadObject(_Obj);
  1185.   Result := Narrow(_Obj, True)
  1186. end;
  1187.  
  1188. class procedure TSeqAccountHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.SeqAccount);
  1189. begin
  1190.   _Output.WriteObject(_Value as CORBA.CORBAObject);
  1191. end;
  1192.  
  1193. class function TSeqAccountHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.SeqAccount;
  1194. begin
  1195.   Result := nil;
  1196.   if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.SeqAccount, Result) = 0) then
  1197.     exit;
  1198.   if _IsA and _Obj._IsA(RepositoryId) then
  1199.     Result := TSeqAccountStub.Create(_Obj);
  1200. end;
  1201.  
  1202. class function TSeqAccountHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.SeqAccount;
  1203. begin
  1204.   Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
  1205. end;
  1206.  
  1207. class function TSeqAccountHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.SeqAccount;
  1208. begin
  1209.   Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
  1210. end;
  1211.  
  1212. function  TSeqAccountStub.balance ( const mySeq : DrBob42_i.IntSeq): Single;
  1213. var
  1214.   _Output: CORBA.OutputStream;
  1215.   _Input : CORBA.InputStream;
  1216. begin
  1217.   inherited _CreateRequest('balance',True, _Output);
  1218.   DrBob42_c.TIntSeqHelper.Write(_Output, mySeq);
  1219.   inherited _Invoke(_Output, _Input);
  1220.   _Input.ReadFloat(Result);
  1221. end;
  1222.  
  1223.  
  1224. initialization
  1225. DrBob42_c.AccountExceptionDesc := RegisterUserException('AccountException', 'IDL:DrBob42/AccountException:1.0', @DrBob42_c.AccountException_Factory);
  1226.  
  1227.  
  1228. finalization
  1229. UnRegisterUserException(DrBob42_c.AccountExceptionDesc);
  1230.  
  1231.  
  1232. end.